<!DOCTYPE html>
<html>
	<head>
		<title>1-6-4</title>
		<meta charset="utf-8" />
		<script type="text/javascript">
			var newWindow;
			//打开新窗口
			function openNewWindow(){
				newWindow = window.open("newwindow.html");
			}
			
			//关闭新打开的窗口
			function closeNewWindow(){
				if(newWindow) {
					newWindow.close();
				}
			}
		</script>
	</head>
	<body>
		<input type="button" value="打开新窗口" onclick="openNewWindow();" />
		<input type="button" value="关闭新窗口" onclick="closeNewWindow();" />
	</body>
</html>